<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property int $userId 用户ID
 * @property string $username 用户名
 * @property int $password 密码
 * @property string $userImg 用户头像
 */
class User extends \yii\db\ActiveRecord
{


    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['username', 'password', 'userImg'], 'required'],
            [['password'], 'integer'],
            [['username'], 'string', 'max' => 100],
            [['userImg'], 'string', 'max' => 200],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'userId' => 'User ID',
            'username' => 'Username',
            'password' => 'Password',
            'userImg' => 'User Img',
        ];
    }

}
